<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ page import="com.towker.frame.model.rbac.Subsystem" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@include file="/commons/include/html_doctype.html"%>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<link type="text/css" rel="stylesheet" href="${ctx}/js/easyui/css/default/layout.css" />
<link type="text/css" rel="stylesheet" href="${ctx}/js/easyui/css/default/panel.css" />
<link type="text/css" rel="stylesheet" href="${ctx}/js/jquery/ui/css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="style/frame.css" />
<link href="css/web.css" type="text/css" rel="stylesheet" />
<style type="text/css">
#div_top{background-image:url(${ctx}/themes/img/frame/top_back.jpg)}
#tb_top{border-collapse:collapse;}
#td_logo{width:5%;}
#td_menu{width:25%;}
#menuPanel .ui-accordion-content { padding: 5px 0px 0px 10px; }
#menuPanel { line-height:18px; padding-left:2px; }
#menuPanel ul { padding:0px; margin:0px; list-style:none; }
#menuPanel li span { float:left; margin-right:5px; margin-bottom:5px; }
#menuPanel li { list-style:none; margin-left:0px; padding-left:0px; clear:both;  }
</style>
<script type="text/javascript" src="${ctx}/js/jquery/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/easyui/jquery.easyui.js"></script>
<script type="text/javascript" src="${ctx}/js/jquery/ui/jquery-ui.js"></script>

<script type="text/javascript">
var ctx = "${ctx}";
$(function(){
	var _main="div_main",_frame="ifrm_main";
	//布局与加载
	$("body").layout("panel","west").panel({onCollapse:autoSize,onExpand:autoSize});
	autoSize();
	_load();
	//iframe和外边框高宽自适应
	function autoSize(){
		$("#"+_frame).css("width", $("#"+_main).width()).css("height", $("#"+_main).height() - 5);
	}
	
	
	//加载
	function _load(){
		$.post("${ctx}/manage/rbac/res/getUserResTree.htm",{sysid:"1",userid:"${param.user}"},function(data) {
			eval("var d = " + data + ';');
			//_tree=$("#"+_id).zTree({isSimpleData:true,treeNodeKey:"id",treeNodeParentKey:"pid",callback:{click:_ztreeClick},expandSpeed:""},eval(data));
			var mo = $('#menuPanel');
			for(var i = 0; i < d.length; i++) {
				var m = d[i];
				if(m.pid == 0) {
					mo.append('<h3>'+m.name+'</h3>');
					mo.append('<div><ul id="ul_'+m.id+'"></ul></div>');
				} else {
					var pm = $('#ul_' + m.pid);
					pm.append('<li><span class="ui-icon ui-icon-circle-arrow-e"></span><a href="'+ctx+m._url+'" target="ifrm_main">'+m.name+'</a></li>');
				}
			}
			var icons = {
				header: "ui-icon-circle-arrow-e",
				activeHeader: "ui-icon-circle-arrow-s"
			};	
			$( "#menuPanel" ).accordion({
				icons: icons,
				heightStyle: "content",
				collapsible: true,
				active : false
			});
			//document.write($( "#menuPanel" ).html());
		});
	}
	$("#ifrm_main").attr("src","${ctx}/manage/complex/showIndex.htm"); //设置进入系统时候 主页面显示内容 
});
</script>
</head>
<body class="easyui-layout">
    <div region="west" title="系统管理" style="width:200px;">
        <div id="menuPanel"></div>
    </div>
<div id="div_main" region="center"><iframe id="ifrm_main" name="ifrm_main"  frameborder="0" />  
</div>
</body>
</html>